package com.gxa.controller;

import com.gxa.dto.ResultDto;
import com.gxa.pojo.Log;
import com.gxa.service.LogService;
import com.gxa.util.Response;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/log")
public class LogController {

    @Autowired
    private LogService logService;

    @GetMapping("/page")
    public String logListPage(){
        return "/systemLog/log";
    }

    @RequestMapping("/list")
    @ResponseBody
    public ResultDto logList(){
        List<Log> all = logService.findAll();
        return Response.success("查找成功！", all);
    }

}
